home *** CD-ROM | disk | FTP | other *** search
/ Agent Central Host Computer / Agent - Central Host Computer.iso / _SETUP.1 / vcuraccparts.sql < prev    next >
Text File  |  2000-05-12  |  596b  |  18 lines

  1. /*
  2. This view uses the context information. For each unique context combination, the total dollars from curacc and the count of records summed is given.
  3. */
  4. CREATE OR REPLACE VIEW VCURACCPARTS AS SELECT distinct  
  5. MSTRREC.PROBE_CONTEXT,  
  6. MSTRREC.OPERATOR_CONTEXT,  
  7. MSTRREC.DRIVER_CONTEXT,  
  8. MSTRREC.FARE_CONTEXT,  
  9. count(MSTRREC.PROBE_CONTEXT) pcount,
  10. sum(curacc.currency_val) * 0.01 pdollars  
  11. FROM  
  12. MSTRREC ,curacc  
  13. where curacc.det_seq_num = mstrrec.det_seq_num  
  14. group by MSTRREC.PROBE_CONTEXT,  
  15. MSTRREC.OPERATOR_CONTEXT,  
  16. MSTRREC.DRIVER_CONTEXT,  
  17. MSTRREC.FARE_CONTEXT;
  18.